#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'tian'
__data__ = '2021/9/29 11:09'
# software: PyCharm



class Tracer:

    def __init__(self):
        self.user = None
        self.price_policy = None
        self.project = None


class AuthMiddleware:

    def process_request(self):
        """
        用户已登录，在request中赋值
        :param request:
        :return:
        """
        tracer = Tracer()
        # 用户已登录就有会user_id，没有给0
        # user_id = 12
        # user_object对象有值说明已经登录
        print(tracer.user)
        print(tracer.price_policy)
        print(tracer.project)
        tracer.user = "tian"
        print(tracer.user)

if __name__ == '__main__':

    obj = AuthMiddleware()
    obj.process_request()
